ARMCC=arm-brcm-linux-gnueabi-gcc
X86CC=gcc
ifneq ($(KERNELRELEASE),)
#obj-m:=zero.o
#module-objs:=zero.o
obj-m:=bcm_udc_dwc.o
module-objs:=bcm_udc_dwc.o
else
X86_KERNELDIR ?= /lib/modules/$(shell uname -r)/build
#X86_KERNELDIR ?= /lib/modules/2.6.32/build
#ARM_KERNELDIR?=/home/usr/work/589x_LINUX_5.2.3_SDK/work/projects/bcm589x/build-output/secuapp/BCM95892/linux
ARM_KERNELDIR?=/home/usr/work/589x_Linux_4.4a_SDK/work/projects/bcm589x/build-output/secuapp/BCM95892/linux
PWD := $(shell pwd)

armmod:
	$(MAKE) -C $(ARM_KERNELDIR) M=$(PWD) modules

x86mod:
	$(MAKE) -C $(X86_KERNELDIR) M=$(PWD) modules
.PHONY:

armapp:
	$(ARMCC) -c ft5x06_ts_app.c -o ft5x06_ts_app.o
	$(ARMCC) -o ft5x06_ts_app.exe ft5x06_ts_app.o

x86app:
	$(X86CC) -c main.c -o main.o
	$(X86CC) -o main.exe main.o
.PHONY:modclean
modclean:
	rm *.mod.c *.ko *.o *.order *.symvers
.PHONY:appclean
appclean:
	rm *.exe *.o
clean:
	rm *.mod.c *.ko *.o *.exe
endif
